﻿using System;
using System.Data;
using BLL;
namespace UI.ModEmployee
{
    public partial class EmpCreateCode : System.Web.UI.Page
    {
        EmployeeBiz employeeBiz = new EmployeeBiz();
        DefDicBiz defDicBiz = new DefDicBiz();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt = new BizSQL().ExecSQL2("select memo as ID,name from Admin_EmpCodeConf order by AbsIndex asc").Tables[0];
                defDicBiz.InitDropDownList(dt, DDLCodeRule, "");
            }
        }

        protected void btnCreate_Click(object sender, EventArgs e)
        {
            string strHead = DDLCodeRule.SelectedValue;
            if (string.IsNullOrWhiteSpace(strHead)) strHead = "0";
            //按序号生成

            string createCode = employeeBiz.CreateEmpCode(strHead);
            ltContent.Text = " <a style=\"cursor:hand\" onclick=\"javascript:aclose('" + createCode + "')\">" + createCode + "</a>";

        }
    }
}